@extends('Layout/adminBase')
@section('css')
<link rel="stylesheet" type="text/css" href="{{asset('/bootstrap/css/bootstrap.min.css')}}">
<style type="text/css">
    .head-div{
        height: 70px;
    }
    .head-div .head-left{
        margin-left:20px;
    }
 
    .main-div{
        padding:50px;
    }
    .main-div .main-form{
        margin-left:230px;
    }
    .middle{
        height: 20px;
        background: #d5d5d8;
    }

</style>
@endsection
@section('body')
	
	
	<div class="head-div">
	
		<div class='head-left'>
		    <h4>添加积分商品</h4>
		</div>
		</div>
		
		<div class="main-div">
		<form class="form-horizontal main-form" role="form" action="{{url('admin/integral/update')}}" method="post" enctype="multipart/form-data">
		{{csrf_field()}}
		@foreach ($goods as $v)
			<input type="hidden" name="id" value="{{$v['id']}}">
			<input type="hidden" name="pic" value="{{$v['image']}}">
		    <div class="form-group">
		        <label for="firstname" class="col-sm-2 control-label">商品名</label>
		        <div class="col-sm-5">
		            <input type="text" class="form-control" name="name" value="{{$v['ig_name']}}">
		        </div>
		    </div>
		    <div class="form-group">
		        <label for="firstname" class="col-sm-2 control-label">商品图片</label>
		        <div class="col-sm-5">
		            <input type="file" name="image"><br>
		            原图片：<img src="{{$v['image']}}" style="width:50px; height:30px;">
		        </div>
		    </div>
		    <div class="form-group">
		        <label for="firstname" class="col-sm-2 control-label">商品详情</label>
		        <div class="col-sm-5">
		            <textarea class="form-control" rows="3" name="detail">{{$v['detail']}}</textarea>
		        </div>
		    </div>
		    <div class="form-group">
		        <label for="lastname" class="col-sm-2 control-label">积分价格</label>
		        <div class="col-sm-5">
		            <input type="text" class="form-control"  name='price' value="{{$v['integral_price']}}">
		        </div>
		    </div>

		    <div class="form-group">
		        <label for="lastname" class="col-sm-2 control-label">库存</label>
		        <div class="col-sm-5">
		            <input type="text" class="form-control"  name='stock' value="{{$v['stock']}}">
		        </div>
		    </div>

		    <div class="form-group">
            <label for="lastname" class="col-sm-2 control-label">商品状态</label>
            <div class="col-sm-5">
                <select name='status'  class="form-control">
                    <option value="1" <?php echo $state==1?'selected':'';?>>新上架</option>
                    <option value="2" <?php echo $state==2?'selected':'';?>>在售</option>
                    <option value="3" <?php echo $state==3?'selected':'';?>><?php echo $state==3?'已下架':'下架';?></option>
                </select>
            </div>
        </div>
        @endforeach
		    <div class="form-group">
		        <div class="col-sm-offset-2 col-sm-5">
		            <button class="btn btn-success">修改</button>
		            
		        </div>
		    </div>
		</form>
	</div>
@endsection
